/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package customers;

import avenue.MyWindowEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import model.Card;
import model.Customer;
import model.DBManager;
import model.Vehicle;
import model.Collection;

/**
 *
 * @author Aggelos
 */
public class ListClientForm extends javax.swing.JFrame
{

    /**
     * Creates new form ListClientForm
     */
    private EntityManager em;
    JFrame thisFrame;
    Customer c;
    int s;
    //List<Vehicle> vehicleList

    public ListClientForm()
    {
        em = DBManager.em;
        if (!em.getTransaction().isActive())
          {
            em.getTransaction().begin();
          }
        initComponents();
        setLocationRelativeTo(null);

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents()
    {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        selectClientQUERY = java.beans.Beans.isDesignTime() ? null : em.createQuery("select c from Customer c");
        selectClientLIST = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(selectClientQUERY.getResultList());
        jScrollPane1 = new javax.swing.JScrollPane();
        clientTable = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        newCustomerButton = new javax.swing.JButton();
        deleteCustomerButton = new javax.swing.JButton();
        editCustomerButton = new javax.swing.JButton();
        saveButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        saveAndBackButton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        statusLabel = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        clientTable.getTableHeader().setReorderingAllowed(false);

        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, selectClientLIST, clientTable);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
        columnBinding.setColumnName("ID");
        columnBinding.setColumnClass(Integer.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${FName}"));
        columnBinding.setColumnName("Όνομα");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${LName}"));
        columnBinding.setColumnName("Επώνυμο");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${address}"));
        columnBinding.setColumnName("Διεύθυνση");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${adt}"));
        columnBinding.setColumnName("ΑΔΤ");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${afm}"));
        columnBinding.setColumnName("ΑΦΜ");
        columnBinding.setColumnClass(Integer.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${city}"));
        columnBinding.setColumnName("Πόλη");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${email}"));
        columnBinding.setColumnName("Email");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${phone}"));
        columnBinding.setColumnName("Τηλέφωνο");
        columnBinding.setColumnClass(String.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${zipCode}"));
        columnBinding.setColumnName("ΤΚ");
        columnBinding.setColumnClass(Integer.class);
        columnBinding.setEditable(false);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane1.setViewportView(clientTable);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel1.setText("Πελάτες:");

        newCustomerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/add.gif"))); // NOI18N
        newCustomerButton.setText("Νέος");
        newCustomerButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                newCustomerButtonActionPerformed(evt);
            }
        });

        deleteCustomerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/remove.gif"))); // NOI18N
        deleteCustomerButton.setText("Διαγραφή");
        deleteCustomerButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                deleteCustomerButtonActionPerformed(evt);
            }
        });

        editCustomerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/edit1.png"))); // NOI18N
        editCustomerButton.setText("Επεξεργασία");
        editCustomerButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                editCustomerButtonActionPerformed(evt);
            }
        });

        saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/save.gif"))); // NOI18N
        saveButton.setText("Αποθήκευση");
        saveButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                saveButtonActionPerformed(evt);
            }
        });

        cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cancel.gif"))); // NOI18N
        cancelButton.setText("Ακυρο");
        cancelButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                cancelButtonActionPerformed(evt);
            }
        });

        saveAndBackButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/save.gif"))); // NOI18N
        saveAndBackButton.setText("Αποθήκευση Αλλαγών και Επιστροφή");
        saveAndBackButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                saveAndBackButtonActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N
        jLabel2.setText("Πίνακας Πελατών");

        statusLabel.setText("Κατάσταση εγγραφών");

        jButton1.setText("System.exit(0)");
        jButton1.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 816, Short.MAX_VALUE)
                            .addComponent(jSeparator1)
                            .addComponent(jSeparator2)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(saveButton)
                        .addGap(18, 18, 18)
                        .addComponent(saveAndBackButton)
                        .addGap(18, 18, 18)
                        .addComponent(cancelButton)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(statusLabel)
                                .addGap(23, 23, 23))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton1)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(newCustomerButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deleteCustomerButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(editCustomerButton)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(newCustomerButton)
                    .addComponent(deleteCustomerButton)
                    .addComponent(editCustomerButton))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(25, 25, 25)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(saveButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(cancelButton)
                            .addComponent(saveAndBackButton)
                            .addComponent(jButton1)))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(statusLabel)))
                .addContainerGap())
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void newCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newCustomerButtonActionPerformed
        // TODO add your handling code here:

        c = new Customer();
        em.persist(c);
        EditClientForm ecf = new EditClientForm(c, false);

        ecf.setVisible(true);
        thisFrame = this;
        thisFrame.setEnabled(false);
        //************
        ecf.addWindowListener(new WindowListener()
        {
            public void windowClosed(WindowEvent arg0)
            {
                System.out.println("Window close event occur - SAVE button clicked");
                if (((MyWindowEvent) arg0).exitAndSave)
                  {
                    selectClientLIST.add(c);
                    int row = selectClientLIST.size() - 1;

                    clientTable.setRowSelectionInterval(row, row);
                    clientTable.scrollRectToVisible(clientTable.getCellRect(row, 0, true));
                    thisFrame.setEnabled(true);
                  }
                else
                  {
                    System.out.println("Window close event occur - CANCEL button clicked");
                    thisFrame.setEnabled(true);
                    if (em.getTransaction().isActive())
                      {
                        em.getTransaction().rollback();//original
                        statusLabel.setText("Δεν υπάρχουν Αλλαγές");
                      }

                    em.getTransaction().begin();

                    java.util.Collection data = selectClientQUERY.getResultList();
                    for (Object entity : data)
                      {
                        em.refresh(entity);
                      }
                    selectClientLIST.clear();
                    selectClientLIST.addAll(data);
                  }
            }

            public void windowActivated(WindowEvent arg0)
            {
                System.out.println("Window Activated");
            }

            public void windowClosing(WindowEvent arg0)
            {
                System.out.println("Window Closing");
            }

            public void windowDeactivated(WindowEvent arg0)
            {
                System.out.println("Window Deactivated");
            }

            public void windowDeiconified(WindowEvent arg0)
            {
                System.out.println("Window Deiconified");
            }

            public void windowIconified(WindowEvent arg0)
            {
                System.out.println("Window Iconified");
            }

            public void windowOpened(WindowEvent arg0)
            {
                System.out.println("Window Opened");
            }
        });
        //************




    }//GEN-LAST:event_newCustomerButtonActionPerformed

    private void editCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editCustomerButtonActionPerformed
        // TODO add your handling code here:

        s = clientTable.getSelectedRow();
        if (s >= 0)
          {
            c = selectClientLIST.get(s);
            em.persist(c);


            EditClientForm ecf = new EditClientForm(c, true);

            ecf.setVisible(true);
            thisFrame = this;
            thisFrame.setEnabled(false);
            //************
            ecf.addWindowListener(new WindowListener()
            {
                public void windowClosed(WindowEvent arg0)
                {
                    System.out.println("Window close event occur");
                    if (((MyWindowEvent) arg0).exitAndSave)
                      {

                     //   em.merge(c);
			selectClientLIST.set(s, c);			
                        clientTable.setRowSelectionInterval(s, s);
                        clientTable.scrollRectToVisible(clientTable.getCellRect(s, 0, true));
			clientTable.repaint();
                        thisFrame.setEnabled(true);
                      }
                    else
                      {
                        thisFrame.setEnabled(true);

                        if (em.getTransaction().isActive())
                          {
                            em.getTransaction().rollback();
                          }

                        em.getTransaction().begin();
                        java.util.Collection data = selectClientQUERY.getResultList();
                        for (Object entity : data)
                          {
                            em.refresh(entity);
                          }
                        selectClientLIST.clear();
                        selectClientLIST.addAll(data);
                      }
                }

                public void windowActivated(WindowEvent arg0)
                {
                    System.out.println("Window Activated");
                }

                public void windowClosing(WindowEvent arg0)
                {
                    System.out.println("Window Closing");
                }

                public void windowDeactivated(WindowEvent arg0)
                {
                    System.out.println("Window Deactivated");
                }

                public void windowDeiconified(WindowEvent arg0)
                {
                    System.out.println("Window Deiconified");
                }

                public void windowIconified(WindowEvent arg0)
                {
                    System.out.println("Window Iconified");
                }

                public void windowOpened(WindowEvent arg0)
                {
                    System.out.println("Window Opened");
                }
            });
          }
    }//GEN-LAST:event_editCustomerButtonActionPerformed

    public List<Vehicle> retrieveVehiclesByCustomer(Customer cust)
    {
        System.out.println(cust.getId());


        String strSQL = "select j from Vehicle j where j.custId=:custId";
        Query vehicleQuery = em.createQuery(strSQL)
                .setParameter("custId", cust);
        List vehicleLIST = vehicleQuery.getResultList();
        // System.out.println(vehicleQuery.toString());
        return vehicleLIST;

    }

    public model.Collection retrieveCollectionByVehicle(Vehicle v)
    {
        System.out.println(v.getId());
        Collection col = null;
        try
          {
            String strSQL = "select c from Collection c where c.vehicleId=:vehicleId ";
            Query colQuery = em.createQuery(strSQL)
                    .setParameter("vehicleId", v);
            col = (Collection) colQuery.getSingleResult();

          }
        catch (Exception ex)
          {
            return col;
          }
        return col;
    }

    private void deleteCustomerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteCustomerButtonActionPerformed


        List<model.Collection> colList = new ArrayList<Collection>();
        model.Collection col_temp = null;

        s = clientTable.getSelectedRow();
        c = selectClientLIST.get(s);

        if (s >= 0)
          {


            List<Vehicle> vListbyClient = retrieveVehiclesByCustomer(c);

            for (int i = 0; i < vListbyClient.size(); i++)
              {
                Vehicle vehicle = vListbyClient.get(i);
                col_temp = retrieveCollectionByVehicle(vehicle);
                if (col_temp != null)
                  {
                    colList.add(col_temp);
                  }

              }
            if (colList.isEmpty())
              {
                System.out.println("Μπορει να διαγραφει ο χρηστης .Τα οχηματα τα του δεν εχουν διέλευση");

                selectClientLIST.remove(c);
                em.remove(c);
              }
            else
              {
                JOptionPane.showMessageDialog(this, "Δεν μπορει να διαγραφει ο χρηστης. \n "
                        + "Τα οχηματα τα του εχουν διέλευση",
                        "Διαγραφή", JOptionPane.ERROR_MESSAGE);
              }
          }

    }//GEN-LAST:event_deleteCustomerButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        // TODO add your handling code here:
//        /////////////////original
//        //  this.avenuePUEntityManager.persist(this.vehicle1);
////        em.getTransaction().commit();
////        em.getTransaction().begin();
////        dispose();
//        ///////////////////////////////////////

        try
          {
            if (em.getTransaction().isActive())
              {
                em.getTransaction().commit();
                statusLabel.setText("Αλλαγές Αποθηκεύτηκαν");
              }

            if (!em.getTransaction().isActive())
              {
                em.getTransaction().begin();//original
                em.getTransaction().commit();
                statusLabel.setText("Αλλαγές Αποθηκεύτηκαν");
              }
          }
        catch (Exception e)
          {
            JOptionPane.showMessageDialog(this, "error in saving");
          }
    }//GEN-LAST:event_saveButtonActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        // TODO add your handling code here:
        if (em.getTransaction().isActive())
          {
            em.getTransaction().rollback();
          }
        if (!em.getTransaction().isActive())
          {
            em.getTransaction().begin();
            em.getTransaction().rollback();
          }

        MyWindowEvent we = new MyWindowEvent(this, WindowEvent.WINDOW_CLOSED, false);
        for (WindowListener l : this.getWindowListeners())
          {
            l.windowClosed(we);
          }
        this.setVisible(false);

    }//GEN-LAST:event_cancelButtonActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
    {//GEN-HEADEREND:event_jButton1ActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void saveAndBackButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_saveAndBackButtonActionPerformed
    {//GEN-HEADEREND:event_saveAndBackButtonActionPerformed

        try
          {
            if (em.getTransaction().isActive())
              {
                em.getTransaction().commit();
                statusLabel.setText("Αλλαγές Αποθηκεύτηκαν");
              }

            if (!em.getTransaction().isActive())
              {
                em.getTransaction().begin();//original
                em.getTransaction().commit();
                statusLabel.setText("Αλλαγές Αποθηκεύτηκαν");
              }
          }
        catch (Exception e)
          {
            JOptionPane.showMessageDialog(this, "error in saving");
            statusLabel.setText("Αλλαγές ΜΗ ΑΠΟΘΗΚΕΥΜΕΝΕΣ");
          }

        MyWindowEvent we = new MyWindowEvent(this, WindowEvent.WINDOW_CLOSED, true);
        for (WindowListener l : this.getWindowListeners())
          {
            l.windowClosed(we);
          }
        this.setVisible(false);
    }//GEN-LAST:event_saveAndBackButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try
          {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
              {
                if ("Nimbus".equals(info.getName()))
                  {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                  }
              }
          }
        catch (ClassNotFoundException ex)
          {
            java.util.logging.Logger.getLogger(ListClientForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
        catch (InstantiationException ex)
          {
            java.util.logging.Logger.getLogger(ListClientForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
        catch (IllegalAccessException ex)
          {
            java.util.logging.Logger.getLogger(ListClientForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
        catch (javax.swing.UnsupportedLookAndFeelException ex)
          {
            java.util.logging.Logger.getLogger(ListClientForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
                new ListClientForm().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelButton;
    private javax.swing.JTable clientTable;
    private javax.swing.JButton deleteCustomerButton;
    private javax.swing.JButton editCustomerButton;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JButton newCustomerButton;
    private javax.swing.JButton saveAndBackButton;
    private javax.swing.JButton saveButton;
    private java.util.List<Customer> selectClientLIST;
    private javax.persistence.Query selectClientQUERY;
    private javax.swing.JLabel statusLabel;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
